package com.csproj.dispatch.domain;

import com.csproj.dispatch.util.ContainerStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;


/**
 * 调度表
 */
@ApiModel(description = "调度表")
@Entity
@Table(name = "t_base_dispatch")
public class Dispatch implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name = "id")
    private String id;

    /**
     * 集装箱主键
     */
    @ApiModelProperty(value = "集装箱主键")
    @Column(name = "container_id")
    private String containerId;

    /**
     * 集装箱编号
     */
    @ApiModelProperty(value = "集装箱编号")
    @Column(name = "container_code")
    private String containerCode;

    /**
     * 物流信息主键
     */
    @ApiModelProperty(value = "物流信息主键")
    @Column(name = "logistics_id")
    private String logisticsId;

    /**
     * 货物基本信息主键
     */
    @ApiModelProperty(value = "货物基本信息主键")
    @Column(name = "product_info_id")
    private String productInfoId;

    /**
     * 路径编号
     */
    @ApiModelProperty(value = "路径编号")
    @Column(name = "route_code")
    private String routeCode;

    @ApiModelProperty(value = "路径主键")
    @Column(name = "route_id")
    private String routeId;

    /**
     * 手持机编号
     */
    @ApiModelProperty(value = "手持机编号")
    @Column(name = "handset_code")
    private String handsetCode;

    /**
     * 关锁编号
     */
    @ApiModelProperty(value = "关锁编号")
    @Column(name = "lock_code")
    private String lockCode;

    /**
     * 车牌号
     */
    @ApiModelProperty(value = "车牌号")
    @Column(name = "platenumber")
    private String platenumber;

    /**
     * 启运站点主键
     */
    @ApiModelProperty(value = "启运站点主键")
    @Column(name = "launchsite_id")
    private String launchsiteId;

    /**
     * 目的站点主键
     */
    @ApiModelProperty(value = "目的站点主键")
    @Column(name = "destinationsite_id")
    private String destinationsiteId;

    @ApiModelProperty(value = "限时")
    @Column(name = "time_limit")
    private String timeLimit;//限时

    /**
     * 启运时间
     */
    @ApiModelProperty(value = "启运时间")
    @Column(name = "launch_time")
    private ZonedDateTime launchTime;

    /**
     * 预计到达时间
     */
    @ApiModelProperty(value = "预计到达时间")
    @Column(name = "expectedarrive_time")
    private ZonedDateTime expectedarriveTime;

    /**
     * 实际到达时间
     */
    @ApiModelProperty(value = "实际到达时间")
    @Column(name = "arrive_time")
    private ZonedDateTime arriveTime;

    /**
     * 集装箱状态
     */
    @ApiModelProperty(value = "集装箱状态")
    @Column(name = "container_status")
    private String containerStatus;

    @Transient
    private ContainerStatus cstatus;

    @Column(name = "deleted_flag")
    private Boolean deletedFlag;

    /**
     * 删除人
     */
    @ApiModelProperty(value = "删除人")
    @Column(name = "deleter_user_id")
    private String deleterUserId;

    /**
     * 删除时间
     */
    @ApiModelProperty(value = "删除时间")
    @Column(name = "deletion_time")
    private ZonedDateTime deletionTime;

    /**
     * 最近更新时间
     */
    @ApiModelProperty(value = "最近更新时间")
    @Column(name = "last_modification_time")
    private ZonedDateTime lastModificationTime;

    /**
     * 最近更新人
     */
    @ApiModelProperty(value = "最近更新人")
    @Column(name = "last_modifier_user_id")
    private String lastModifierUserId;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "creation_time")
    private ZonedDateTime creationTime;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Column(name = "creator_user_id")
    private String creatorUserId;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getContainerId() {
        return containerId;
    }

    public Dispatch containerId(String containerId) {
        this.containerId = containerId;
        return this;
    }

    public void setContainerId(String containerId) {
        this.containerId = containerId;
    }

    public String getContainerCode() {
        return containerCode;
    }

    public Dispatch containerCode(String containerCode) {
        this.containerCode = containerCode;
        return this;
    }

    public void setContainerCode(String containerCode) {
        this.containerCode = containerCode;
    }

    public String getLogisticsId() {
        return logisticsId;
    }

    public Dispatch logisticsId(String logisticsId) {
        this.logisticsId = logisticsId;
        return this;
    }

    public void setLogisticsId(String logisticsId) {
        this.logisticsId = logisticsId;
    }

    public String getProductInfoId() {
        return productInfoId;
    }

    public Dispatch productInfoId(String productInfoId) {
        this.productInfoId = productInfoId;
        return this;
    }

    public void setProductInfoId(String productInfoId) {
        this.productInfoId = productInfoId;
    }

    public String getRouteCode() {
        return routeCode;
    }

    public Dispatch routeCode(String routeCode) {
        this.routeCode = routeCode;
        return this;
    }

    public void setRouteCode(String routeCode) {
        this.routeCode = routeCode;
    }

    public String getHandsetCode() {
        return handsetCode;
    }

    public Dispatch handsetCode(String handsetCode) {
        this.handsetCode = handsetCode;
        return this;
    }

    public void setHandsetCode(String handsetCode) {
        this.handsetCode = handsetCode;
    }

    public String getLockCode() {
        return lockCode;
    }

    public Dispatch lockCode(String lockCode) {
        this.lockCode = lockCode;
        return this;
    }

    public void setLockCode(String lockCode) {
        this.lockCode = lockCode;
    }

    public String getPlatenumber() {
        return platenumber;
    }

    public Dispatch platenumber(String platenumber) {
        this.platenumber = platenumber;
        return this;
    }

    public void setPlatenumber(String platenumber) {
        this.platenumber = platenumber;
    }

    public String getLaunchsiteId() {
        return launchsiteId;
    }

    public Dispatch launchsiteId(String launchsiteId) {
        this.launchsiteId = launchsiteId;
        return this;
    }

    public void setLaunchsiteId(String launchsiteId) {
        this.launchsiteId = launchsiteId;
    }

    public String getDestinationsiteId() {
        return destinationsiteId;
    }

    public Dispatch destinationsiteId(String destinationsiteId) {
        this.destinationsiteId = destinationsiteId;
        return this;
    }

    public void setDestinationsiteId(String destinationsiteId) {
        this.destinationsiteId = destinationsiteId;
    }

    public ZonedDateTime getLaunchTime() {
        return launchTime;
    }

    public Dispatch launchTime(ZonedDateTime launchTime) {
        this.launchTime = launchTime;
        return this;
    }

    public void setLaunchTime(ZonedDateTime launchTime) {
        this.launchTime = launchTime;
    }

    public ZonedDateTime getExpectedarriveTime() {
        return expectedarriveTime;
    }

    public Dispatch expectedarriveTime(ZonedDateTime expectedarriveTime) {
        this.expectedarriveTime = expectedarriveTime;
        return this;
    }

    public void setExpectedarriveTime(ZonedDateTime expectedarriveTime) {
        this.expectedarriveTime = expectedarriveTime;
    }

    public ZonedDateTime getArriveTime() {
        return arriveTime;
    }

    public Dispatch arriveTime(ZonedDateTime arriveTime) {
        this.arriveTime = arriveTime;
        return this;
    }

    public void setArriveTime(ZonedDateTime arriveTime) {
        this.arriveTime = arriveTime;
    }

    public String getContainerStatus() {
        return containerStatus;
    }

    public void setContainerStatus(String containerStatus) {
        this.containerStatus = containerStatus;
    }

    public Dispatch containerStatus(String containerStatus) {
        this.containerStatus = containerStatus;
        return this;
    }

    public Boolean isDeletedFlag() {
        return deletedFlag;
    }

    public Dispatch deletedFlag(Boolean deletedFlag) {
        this.deletedFlag = deletedFlag;
        return this;
    }

    public void setDeletedFlag(Boolean deletedFlag) {
        this.deletedFlag = deletedFlag;
    }

    public String getDeleterUserId() {
        return deleterUserId;
    }

    public Dispatch deleterUserId(String deleterUserId) {
        this.deleterUserId = deleterUserId;
        return this;
    }

    public void setDeleterUserId(String deleterUserId) {
        this.deleterUserId = deleterUserId;
    }

    public ZonedDateTime getDeletionTime() {
        return deletionTime;
    }

    public Dispatch deletionTime(ZonedDateTime deletionTime) {
        this.deletionTime = deletionTime;
        return this;
    }

    public void setDeletionTime(ZonedDateTime deletionTime) {
        this.deletionTime = deletionTime;
    }

    public ZonedDateTime getLastModificationTime() {
        return lastModificationTime;
    }

    public Dispatch lastModificationTime(ZonedDateTime lastModificationTime) {
        this.lastModificationTime = lastModificationTime;
        return this;
    }

    public void setLastModificationTime(ZonedDateTime lastModificationTime) {
        this.lastModificationTime = lastModificationTime;
    }

    public String getLastModifierUserId() {
        return lastModifierUserId;
    }

    public Dispatch lastModifierUserId(String lastModifierUserId) {
        this.lastModifierUserId = lastModifierUserId;
        return this;
    }

    public void setLastModifierUserId(String lastModifierUserId) {
        this.lastModifierUserId = lastModifierUserId;
    }

    public ZonedDateTime getCreationTime() {
        return creationTime;
    }

    public Dispatch creationTime(ZonedDateTime creationTime) {
        this.creationTime = creationTime;
        return this;
    }

    public void setCreationTime(ZonedDateTime creationTime) {
        this.creationTime = creationTime;
    }

    public String getCreatorUserId() {
        return creatorUserId;
    }

    public Dispatch creatorUserId(String creatorUserId) {
        this.creatorUserId = creatorUserId;
        return this;
    }

    public void setCreatorUserId(String creatorUserId) {
        this.creatorUserId = creatorUserId;
    }

    public String getRouteId() {
        return routeId;
    }

    public Dispatch routeId(String routeId) {
        this.routeId = routeId;
        return this;
    }

    public void setRouteId(String routeId) {
        this.routeId = routeId;
    }

    public String getTimeLimit() {
        return timeLimit;
    }

    public Dispatch timeLimit(String timeLimit) {
        this.timeLimit = timeLimit;
        return this;
    }

    public void setTimeLimit(String timeLimit) {
        this.timeLimit = timeLimit;
    }

    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Dispatch dispatch = (Dispatch) o;
        if (dispatch.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), dispatch.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "Dispatch{" +
            "id=" + getId() +
            ", containerId='" + getContainerId() + "'" +
            ", containerCode='" + getContainerCode() + "'" +
            ", logisticsId='" + getLogisticsId() + "'" +
            ", productInfoId='" + getProductInfoId() + "'" +
            ", routeCode='" + getRouteCode() + "'" +
            ", handsetCode='" + getHandsetCode() + "'" +
            ", lockCode='" + getLockCode() + "'" +
            ", platenumber='" + getPlatenumber() + "'" +
            ", launchsiteId='" + getLaunchsiteId() + "'" +
            ", destinationsiteId='" + getDestinationsiteId() + "'" +
            ", launchTime='" + getLaunchTime() + "'" +
            ", expectedarriveTime='" + getExpectedarriveTime() + "'" +
            ", arriveTime='" + getArriveTime() + "'" +
            ", containerStatus='" + getContainerStatus() + "'" +
            ", deletedFlag='" + isDeletedFlag() + "'" +
            ", deleterUserId='" + getDeleterUserId() + "'" +
            ", deletionTime='" + getDeletionTime() + "'" +
            ", lastModificationTime='" + getLastModificationTime() + "'" +
            ", lastModifierUserId='" + getLastModifierUserId() + "'" +
            ", creationTime='" + getCreationTime() + "'" +
            ", creatorUserId='" + getCreatorUserId() + "'" +
            "}";
    }
}
